<template>
    <view class="g_content" style="padding-top: 40rpx">
<!--        <u-swiper width="100%" imgMode="widthFix" radius="0" :list="swiperList" @click="handleShowImg"></u-swiper>-->
        <view style="margin: 0 auto" :style="{width:bannerHeight+'px'}">
        <u-swiper :list="swiperList" indicator :height="bannerHeight"  imgMode="heightFix"  @click="handleShowImg" radius="0" indicatorActiveColor="#EF483F" indicatorInactiveColor="#F9CEC1"></u-swiper>
        </view>
            <!--        <swiper class="swiper-box" indicator-dots autoplay circular>
            <swiper-item v-for="(item, i) in swiperList" :key="i"  @click="handleShowImg">
                <image style="width: 100%" :src="item" mode="widthFix" />
            </swiper-item>
        </swiper>-->


        <view class="p_20">
            <view class="dis_f_l_c">
                <view class="f_s_18">{{infoData.configName}}</view>
            </view>
            <view class="card_box p_10 m_t_10" style="min-height: 60vh;">
                <view class="ql-editor ql-snow ql-container article" v-html="infoData.remark"></view>
            </view>
        </view>
        <!-- 授权弹窗 -->
        <s-auth-modal />
    </view>
</template>

<script>
import {getBusinessApi, getByKeyApi} from "@/sheep/api/index";
export default {
    name: "info",
    data() {
        return {
            swiperList: [],
            infoData:{
                configName:'张三',
                remark:'',
                url:''
            },
            businessConfigId:'',
            bannerHeight:200,
        }
    },
    onLoad(params) {
        this.businessConfigId = params.businessConfigId;
        this.getInfo()
        this.getBannerHeight()
        // this.infoData = JSON.parse(params.item);
        // this.swiperList = this.infoData.url.split(',');
    },
    methods:{
        async getBannerHeight() {
            let res = await getByKeyApi("caseSwiperHight");
            this.bannerHeight = res.data[0]?.configValue;
        },
        getInfo(){
            getBusinessApi(this.businessConfigId).then(res=>{
                if(res.code == 200){
                    this.infoData = res.data;
                    this.infoData.remark = res.data.remark.replace(/<img/g, '<img style="width:100%" ' );
                    this.swiperList = res.data.url.split(',');
                }
            })
        },
        handleShowImg(){
            uni.previewImage({
                urls: this.swiperList,
                current: 0
            });
        }
    }
}
</script>

<style scoped lang="scss">

.swiper-box {
    width: 100%;
    height: 100vw;
}
</style>
